Assignemnt #105 and 105th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 105th Program
///File name: Hund5prog.java
///Date Finished:4/1/2016
import java.util.Scanner;
public class Hund5prog
{
public static void main( String[] args )
{
int n;
for(n = 1; n < 20; n = n + 1)
{
System.out.print( n );
if(isEven(n) == true && isDivisibleBy3(n) == true)
System.out.println( "<=" );
else if( isEven(n) == true )
System.out.println( "<" );
else if( isDivisibleBy3(n) == true )
System.out.println( "=" );
else
System.out.println();
}
}
public static boolean isEven( int n )
{
boolean even;
if(n%2 == 0)
even = true;
else
even = false;
return even;
}
public static boolean isDivisibleBy3( int n )
{
boolean div;
if(n%3 == 0)
div = true;
else
div = false;
return div;
}
}
Picture of the output